package com.mt.channel.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import com.mt.channel.api.service.IChannelAdminService;
import com.mt.channel.entity.ChannelAdminEntity;
import com.mt.common.PagerInfo;
import com.mt.common.ServiceResult;
@CrossOrigin
@RestController
public class ChannelAdminController {

    @Autowired
    IChannelAdminService channelAdminService;

    @GetMapping("/channelAdmin/findInfo")
    public ServiceResult<ChannelAdminEntity> findInfo(Map<String, Object> params) {
        return channelAdminService.findInfo(params);
    }

    @GetMapping("/channelAdmin/findList")
    public ServiceResult<List<ChannelAdminEntity>> findList(Map<String, Object> params, PagerInfo<?> pagerInfo) {
        return channelAdminService.findList(params, pagerInfo);
    }

    @PostMapping("/channelAdmin/doUpdate")
    public ServiceResult<Integer> doUpdate(ChannelAdminEntity channelAdminEntity) {
        return channelAdminService.doUpdate(channelAdminEntity);
    }

    @PostMapping("/channelAdmin/doInsert")
    public ServiceResult<Integer> doInsert(ChannelAdminEntity channelAdminEntity) {
        return channelAdminService.doInsert(channelAdminEntity);
    }

    @PostMapping("/channelAdmin/doDeleteById")
    public void doDeleteById(Integer channelAdminId) {
        channelAdminService.doDeleteById(channelAdminId);
    }
}
